<?php 
/**
 * eBay Label Printing Program File Profile Database Table Class 
 * this is a Db Table Class , It stores template file names lpp and other information which i have no idea what are they now
 * @package  eBayLabelPrinter
 * @category Models/DbTable
 * @author   Norman Dong <norman.dong@hotmail.com>
 * @version  Initial
 * @copyright LeadCasket.com
 * @link     www.leadcasket.com
 * @license  Commercial
 */
 class Model_DbTable_Template_Fileprofile extends Zend_Db_Table_Abstract 
{
	/**
	 * @var string Class Table Name
	 */
	protected $_name = 'template_file_profile'; 
	/**
	 * Get Seller Group By ID 
	 * Not decide what to do Yet
	 * @param int $idSeller  The Seller ID
	 * @return array  Not decide what to return 
	 */	
	public function getFileProfile($fileProfileID){
		$row = $this->fetchRow('`id_template_file_profile`='.(int)$fileProfileID);
		if(!$row){
			return false;
		}
		return $row->toArray();		
	}
	public function addFileProfile($templateProfileID,$fileProfileName,$templateProfileLpp){
		$data = array(
				'id_template_profile' =>$templateProfileID,
				'id_lpp_template_profile'=>$templateProfileLpp,
				'name_template_file_profile'=>$fileProfileName,
		);
		$this->insert($data);		
		
	}
	public function updateFileProfile($fileProfileID,$templateProfileID,$fileProfileName,$templateProfileLpp){
		$data = array(
				'id_template_profile' =>$templateProfileID,
				'id_lpp_template_profile'=>$templateProfileLpp,
				'name_template_file_profile'=>$fileProfileName,
		);
		$this->update($data,'id_template_file_profile ='.$fileProfileID);	
	}	
	public function deleteFileProfile($fileProfileID){
		$this->delete('id_template_file_profile =' . $fileProfileID);
	}
	public function listFileProfile(){
		$rows = $this->fetchAll('1');
		if(empty($rows)){
			return false;
		}
		return $rows->toArray();		
	}	
	public function getFileProfileByTemplateProfile($templateProfileID){
		$rows = $this->fetchAll('id_template_profile ='.(int)$templateProfileID);
		if(empty($rows)){
			return false;
		}
		return $rows->toArray();		
	}	
				
}
?>